package day0214;

import java.io.InputStream;
import java.io.PrintStream;
import java.util.Map;
import java.util.Properties;

public class SystemDemo {

    public static void main(String[] args) {
        /*
            System 类
         */
        // 标准的输出流
        PrintStream out = System.out;
        out.print("abc");

        // 标准输入流
        InputStream in = System.in;

        // 标准错误流
        PrintStream err = System.err;
//        err.print("错误");

        System.out.println();

        // 1970-01-01 00:00:00:000 到现在的毫秒值
        long timeMillis = System.currentTimeMillis();

        // 以某个时间为起点的 纳秒值
        long nanoTime = System.nanoTime();

        // 1s(秒) = 1000 ms(毫秒) = 1000 * 1000 μs(微秒) = 1000 * 1000 * 1000 ns(纳秒)
        System.out.println(nanoTime);

        Object obj = new Object();
        obj = null;

//        System.gc();

//        Map<String, String> getenv = System.getenv();
//
//        for (Map.Entry<String,String> item: getenv.entrySet()){
//            System.out.println(item.getKey() + " = " + item.getValue());
//        }

//        String path = System.getenv("path");
//        System.out.println(path);

//        Properties properties = System.getProperties();
//        for (Map.Entry<Object, Object> item: properties.entrySet()){
//            System.out.println(item.getKey() + " = " + item.getValue());
//        }

        String str = "abc";

        System.out.println(System.identityHashCode(str));

        System.out.print(System.lineSeparator());

    }
}
